package com.ruoyi.lucky.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.lucky.mapper.TRedBagOpenMapper;
import com.ruoyi.lucky.domain.TRedBagOpen;
import com.ruoyi.lucky.service.ITRedBagOpenService;
import com.ruoyi.common.core.text.Convert;

/**
 * 口令红包开启Service业务层处理
 * 
 * @author liuhongbin
 * @date 2020-11-24
 */
@Service
public class TRedBagOpenServiceImpl implements ITRedBagOpenService 
{
    @Autowired
    private TRedBagOpenMapper tRedBagOpenMapper;

    /**
     * 查询口令红包开启
     * 
     * @param id 口令红包开启ID
     * @return 口令红包开启
     */
    @Override
    public TRedBagOpen selectTRedBagOpenById(Long id)
    {
        return tRedBagOpenMapper.selectTRedBagOpenById(id);
    }

    /**
     * 查询口令红包开启列表
     * 
     * @param tRedBagOpen 口令红包开启
     * @return 口令红包开启
     */
    @Override
    public List<TRedBagOpen> selectTRedBagOpenList(TRedBagOpen tRedBagOpen)
    {
        return tRedBagOpenMapper.selectTRedBagOpenList(tRedBagOpen);
    }

    /**
     * 新增口令红包开启
     * 
     * @param tRedBagOpen 口令红包开启
     * @return 结果
     */
    @Override
    public int insertTRedBagOpen(TRedBagOpen tRedBagOpen)
    {
        tRedBagOpen.setCreateTime(DateUtils.getNowDate());
        return tRedBagOpenMapper.insertTRedBagOpen(tRedBagOpen);
    }

    /**
     * 修改口令红包开启
     * 
     * @param tRedBagOpen 口令红包开启
     * @return 结果
     */
    @Override
    public int updateTRedBagOpen(TRedBagOpen tRedBagOpen)
    {
        tRedBagOpen.setUpdateTime(DateUtils.getNowDate());
        return tRedBagOpenMapper.updateTRedBagOpen(tRedBagOpen);
    }

    /**
     * 删除口令红包开启对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTRedBagOpenByIds(String ids)
    {
        return tRedBagOpenMapper.deleteTRedBagOpenByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除口令红包开启信息
     * 
     * @param id 口令红包开启ID
     * @return 结果
     */
    @Override
    public int deleteTRedBagOpenById(Long id)
    {
        return tRedBagOpenMapper.deleteTRedBagOpenById(id);
    }
}
